<template>
  <div class="home-selected-item-v9 home-selected-item-common">
    <div class="inner">
      <img :src="selectedItem.image.url" alt="">
      <div class="info">
        <div class="intro">
          {{ selectedItem.summaryText }}
        </div>
        <div class="houseNameCommon houseName">{{ selectedItem.houseName }}</div>
        <div class="rateAndPrices">
          <van-rate :size="14" v-model="score" allow-half readonly color="#fff" />
          <div class="prices">¥ {{ selectedItem.finalPrice }}</div>
        </div>

      </div>
    </div>
  </div>
</template>

<script setup>
import { toNumber } from '@vue/shared';
import { computed } from 'vue';

const score = computed(() => toNumber(selectedItem.commentScore))


const { selectedItem } = defineProps({
  selectedItem: {
    type: Object,
    default: () => ({})
  }
})
</script>

<style lang="less" scoped>
.home-selected-item-v9 {
  color: #fff;

  .inner {
    position: relative;

    .houseName {
      font-size: 3.73333vw;
      margin: 1.33333vw 0;
      // overflow: hidden;
      // text-overflow: ellipsis;
      // -webkit-line-clamp: 2;
      // -webkit-box-orient: vertical;
      // display: -webkit-box;
    }


    .info {
      position: absolute;
      bottom: 0;
      font-size: 3.2vw;
      padding: 2.13333vw 2.66667vw;

    }

    .rateAndPrices {
      display: flex;
      margin-top: 2.66667vw;
      justify-content: space-between;
    }
  }


}
</style>